3.1220 \(\int \frac{1}{(a+b \tan (e+f x)) (c+d \tan (e+f x))^2} \, dx\)

Optimal. Leaf size=184 \[ -\frac{x \left (2 b c d-a \left (c^2-d^2\right )\right )}{\left (a^2+b^2\right ) \left (c^2+d^2\right )^2}+\frac{b^3 \log (a \cos (e+f x)+b \sin (e+f x))}{f \left (a^2+b^2\right ) (b c-a d)^2}+\frac{d^2}{f \left (c^2+d^2\right ) (b c-a d) (c+d \tan (e+f x))}+\frac{d^2 \left (2 a c d-b \left (3 c^2+d^2\right )\right ) \log (c \cos (e+f x)+d \sin (e+f x))}{f \left (c^2+d^2\right )^2 (b c-a d)^2} \]

[Out]

-(((2*b*c*d - a*(c^2 - d^2))*x)/((a^2 + b^2)*(c^2 + d^2)^2)) + (b^3*Log[a*Cos[e + f*x] + b*Sin[e + f*x]])/((a^
2 + b^2)*(b*c - a*d)^2*f) + (d^2*(2*a*c*d - b*(3*c^2 + d^2))*Log[c*Cos[e + f*x] + d*Sin[e + f*x]])/((b*c - a*d
)^2*(c^2 + d^2)^2*f) + d^2/((b*c - a*d)*(c^2 + d^2)*f*(c + d*Tan[e + f*x]))

________________________________________________________________________________________

Rubi [A]  time = 0.507971, antiderivative size = 184, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 25, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.12, Rules used = {3569, 3651, 3530} \[ -\frac{x \left (2 b c d-a \left (c^2-d^2\right )\right )}{\left (a^2+b^2\right ) \left (c^2+d^2\right )^2}+\frac{b^3 \log (a \cos (e+f x)+b \sin (e+f x))}{f \left (a^2+b^2\right ) (b c-a d)^2}+\frac{d^2}{f \left (c^2+d^2\right ) (b c-a d) (c+d \tan (e+f x))}+\frac{d^2 \left (2 a c d-b \left (3 c^2+d^2\right )\right ) \log (c \cos (e+f x)+d \sin (e+f x))}{f \left (c^2+d^2\right )^2 (b c-a d)^2} \]

Antiderivative was successfully verified.

[In]

Int[1/((a + b*Tan[e + f*x])*(c + d*Tan[e + f*x])^2),x]

[Out]

-(((2*b*c*d - a*(c^2 - d^2))*x)/((a^2 + b^2)*(c^2 + d^2)^2)) + (b^3*Log[a*Cos[e + f*x] + b*Sin[e + f*x]])/((a^
2 + b^2)*(b*c - a*d)^2*f) + (d^2*(2*a*c*d - b*(3*c^2 + d^2))*Log[c*Cos[e + f*x] + d*Sin[e + f*x]])/((b*c - a*d
)^2*(c^2 + d^2)^2*f) + d^2/((b*c - a*d)*(c^2 + d^2)*f*(c + d*Tan[e + f*x]))

Rule 3569

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Si
mp[(b^2*(a + b*Tan[e + f*x])^(m + 1)*(c + d*Tan[e + f*x])^(n + 1))/(f*(m + 1)*(a^2 + b^2)*(b*c - a*d)), x] + D
ist[1/((m + 1)*(a^2 + b^2)*(b*c - a*d)), Int[(a + b*Tan[e + f*x])^(m + 1)*(c + d*Tan[e + f*x])^n*Simp[a*(b*c -
 a*d)*(m + 1) - b^2*d*(m + n + 2) - b*(b*c - a*d)*(m + 1)*Tan[e + f*x] - b^2*d*(m + n + 2)*Tan[e + f*x]^2, x],
 x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && NeQ[c^2 + d^2, 0] && I
ntegerQ[2*m] && LtQ[m, -1] && (LtQ[n, 0] || IntegerQ[m]) &&  !(ILtQ[n, -1] && ( !IntegerQ[m] || (EqQ[c, 0] &&
NeQ[a, 0])))

Rule 3651

Int[((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)] + (C_.)*tan[(e_.) + (f_.)*(x_)]^2)/(((a_) + (b_.)*tan[(e_.) + (f_.)
*(x_)])*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])), x_Symbol] :> Simp[((a*(A*c - c*C + B*d) + b*(B*c - A*d + C*d
))*x)/((a^2 + b^2)*(c^2 + d^2)), x] + (Dist[(A*b^2 - a*b*B + a^2*C)/((b*c - a*d)*(a^2 + b^2)), Int[(b - a*Tan[
e + f*x])/(a + b*Tan[e + f*x]), x], x] - Dist[(c^2*C - B*c*d + A*d^2)/((b*c - a*d)*(c^2 + d^2)), Int[(d - c*Ta
n[e + f*x])/(c + d*Tan[e + f*x]), x], x]) /; FreeQ[{a, b, c, d, e, f, A, B, C}, x] && NeQ[b*c - a*d, 0] && NeQ
[a^2 + b^2, 0] && NeQ[c^2 + d^2, 0]

Rule 3530

Int[((c_) + (d_.)*tan[(e_.) + (f_.)*(x_)])/((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(c*Log[Re
moveContent[a*Cos[e + f*x] + b*Sin[e + f*x], x]])/(b*f), x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d,
0] && NeQ[a^2 + b^2, 0] && EqQ[a*c + b*d, 0]

Rubi steps

\begin{align*} \int \frac{1}{(a+b \tan (e+f x)) (c+d \tan (e+f x))^2} \, dx &=\frac{d^2}{(b c-a d) \left (c^2+d^2\right ) f (c+d \tan (e+f x))}+\frac{\int \frac{-a c d+b \left (c^2+d^2\right )-d (b c-a d) \tan (e+f x)+b d^2 \tan ^2(e+f x)}{(a+b \tan (e+f x)) (c+d \tan (e+f x))} \, dx}{(b c-a d) \left (c^2+d^2\right )}\\ &=-\frac{\left (2 b c d-a \left (c^2-d^2\right )\right ) x}{\left (a^2+b^2\right ) \left (c^2+d^2\right )^2}+\frac{d^2}{(b c-a d) \left (c^2+d^2\right ) f (c+d \tan (e+f x))}+\frac{b^3 \int \frac{b-a \tan (e+f x)}{a+b \tan (e+f x)} \, dx}{\left (a^2+b^2\right ) (b c-a d)^2}+\frac{\left (d^2 \left (2 a c d-b \left (3 c^2+d^2\right )\right )\right ) \int \frac{d-c \tan (e+f x)}{c+d \tan (e+f x)} \, dx}{(b c-a d)^2 \left (c^2+d^2\right )^2}\\ &=-\frac{\left (2 b c d-a \left (c^2-d^2\right )\right ) x}{\left (a^2+b^2\right ) \left (c^2+d^2\right )^2}+\frac{b^3 \log (a \cos (e+f x)+b \sin (e+f x))}{\left (a^2+b^2\right ) (b c-a d)^2 f}+\frac{d^2 \left (2 a c d-b \left (3 c^2+d^2\right )\right ) \log (c \cos (e+f x)+d \sin (e+f x))}{(b c-a d)^2 \left (c^2+d^2\right )^2 f}+\frac{d^2}{(b c-a d) \left (c^2+d^2\right ) f (c+d \tan (e+f x))}\\ \end{align*}

Mathematica [A]  time = 2.15867, size = 306, normalized size = 1.66 \[ \frac{\frac{2 b d^2 \left (a^2+b^2\right ) \left (b \left (3 c^2+d^2\right )-2 a c d\right ) \log (c+d \tan (e+f x))-2 b^4 \left (c^2+d^2\right )^2 \log (a+b \tan (e+f x))+(b c-a d)^2 \left (a \sqrt{-b^2} \left (c^2-d^2\right )+2 b c d \left (a-\sqrt{-b^2}\right )+b^2 \left (c^2-d^2\right )\right ) \log \left (\sqrt{-b^2}-b \tan (e+f x)\right )+(b c-a d)^2 \left (a \sqrt{-b^2} \left (d^2-c^2\right )+2 b c d \left (a+\sqrt{-b^2}\right )+b^2 \left (c^2-d^2\right )\right ) \log \left (\sqrt{-b^2}+b \tan (e+f x)\right )}{2 b \left (a^2+b^2\right ) \left (c^2+d^2\right ) (b c-a d)}-\frac{d^2}{c+d \tan (e+f x)}}{f \left (c^2+d^2\right ) (a d-b c)} \]

Antiderivative was successfully verified.

[In]

Integrate[1/((a + b*Tan[e + f*x])*(c + d*Tan[e + f*x])^2),x]

[Out]

(((b*c - a*d)^2*(2*b*(a - Sqrt[-b^2])*c*d + b^2*(c^2 - d^2) + a*Sqrt[-b^2]*(c^2 - d^2))*Log[Sqrt[-b^2] - b*Tan
[e + f*x]] - 2*b^4*(c^2 + d^2)^2*Log[a + b*Tan[e + f*x]] + (b*c - a*d)^2*(2*b*(a + Sqrt[-b^2])*c*d + b^2*(c^2
- d^2) + a*Sqrt[-b^2]*(-c^2 + d^2))*Log[Sqrt[-b^2] + b*Tan[e + f*x]] + 2*b*(a^2 + b^2)*d^2*(-2*a*c*d + b*(3*c^
2 + d^2))*Log[c + d*Tan[e + f*x]])/(2*b*(a^2 + b^2)*(b*c - a*d)*(c^2 + d^2)) - d^2/(c + d*Tan[e + f*x]))/((-(b
*c) + a*d)*(c^2 + d^2)*f)

________________________________________________________________________________________

Maple [B]  time = 0.054, size = 412, normalized size = 2.2 \begin{align*} -{\frac{\ln \left ( 1+ \left ( \tan \left ( fx+e \right ) \right ) ^{2} \right ) acd}{f \left ({a}^{2}+{b}^{2} \right ) \left ({c}^{2}+{d}^{2} \right ) ^{2}}}-{\frac{\ln \left ( 1+ \left ( \tan \left ( fx+e \right ) \right ) ^{2} \right ) b{c}^{2}}{2\,f \left ({a}^{2}+{b}^{2} \right ) \left ({c}^{2}+{d}^{2} \right ) ^{2}}}+{\frac{\ln \left ( 1+ \left ( \tan \left ( fx+e \right ) \right ) ^{2} \right ) b{d}^{2}}{2\,f \left ({a}^{2}+{b}^{2} \right ) \left ({c}^{2}+{d}^{2} \right ) ^{2}}}+{\frac{\arctan \left ( \tan \left ( fx+e \right ) \right ) a{c}^{2}}{f \left ({a}^{2}+{b}^{2} \right ) \left ({c}^{2}+{d}^{2} \right ) ^{2}}}-{\frac{\arctan \left ( \tan \left ( fx+e \right ) \right ) a{d}^{2}}{f \left ({a}^{2}+{b}^{2} \right ) \left ({c}^{2}+{d}^{2} \right ) ^{2}}}-2\,{\frac{\arctan \left ( \tan \left ( fx+e \right ) \right ) bcd}{f \left ({a}^{2}+{b}^{2} \right ) \left ({c}^{2}+{d}^{2} \right ) ^{2}}}-{\frac{{d}^{2}}{f \left ( ad-bc \right ) \left ({c}^{2}+{d}^{2} \right ) \left ( c+d\tan \left ( fx+e \right ) \right ) }}+2\,{\frac{{d}^{3}\ln \left ( c+d\tan \left ( fx+e \right ) \right ) ac}{f \left ( ad-bc \right ) ^{2} \left ({c}^{2}+{d}^{2} \right ) ^{2}}}-3\,{\frac{{d}^{2}\ln \left ( c+d\tan \left ( fx+e \right ) \right ) b{c}^{2}}{f \left ( ad-bc \right ) ^{2} \left ({c}^{2}+{d}^{2} \right ) ^{2}}}-{\frac{{d}^{4}\ln \left ( c+d\tan \left ( fx+e \right ) \right ) b}{f \left ( ad-bc \right ) ^{2} \left ({c}^{2}+{d}^{2} \right ) ^{2}}}+{\frac{{b}^{3}\ln \left ( a+b\tan \left ( fx+e \right ) \right ) }{f \left ({a}^{2}+{b}^{2} \right ) \left ( ad-bc \right ) ^{2}}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(a+b*tan(f*x+e))/(c+d*tan(f*x+e))^2,x)

[Out]

-1/f/(a^2+b^2)/(c^2+d^2)^2*ln(1+tan(f*x+e)^2)*a*c*d-1/2/f/(a^2+b^2)/(c^2+d^2)^2*ln(1+tan(f*x+e)^2)*b*c^2+1/2/f
/(a^2+b^2)/(c^2+d^2)^2*ln(1+tan(f*x+e)^2)*b*d^2+1/f/(a^2+b^2)/(c^2+d^2)^2*arctan(tan(f*x+e))*a*c^2-1/f/(a^2+b^
2)/(c^2+d^2)^2*arctan(tan(f*x+e))*a*d^2-2/f/(a^2+b^2)/(c^2+d^2)^2*arctan(tan(f*x+e))*b*c*d-1/f*d^2/(a*d-b*c)/(
c^2+d^2)/(c+d*tan(f*x+e))+2/f*d^3/(a*d-b*c)^2/(c^2+d^2)^2*ln(c+d*tan(f*x+e))*a*c-3/f*d^2/(a*d-b*c)^2/(c^2+d^2)
^2*ln(c+d*tan(f*x+e))*b*c^2-1/f*d^4/(a*d-b*c)^2/(c^2+d^2)^2*ln(c+d*tan(f*x+e))*b+1/f*b^3/(a^2+b^2)/(a*d-b*c)^2
*ln(a+b*tan(f*x+e))

________________________________________________________________________________________

Maxima [B]  time = 1.86785, size = 518, normalized size = 2.82 \begin{align*} \frac{\frac{2 \, b^{3} \log \left (b \tan \left (f x + e\right ) + a\right )}{{\left (a^{2} b^{2} + b^{4}\right )} c^{2} - 2 \,{\left (a^{3} b + a b^{3}\right )} c d +{\left (a^{4} + a^{2} b^{2}\right )} d^{2}} + \frac{2 \,{\left (a c^{2} - 2 \, b c d - a d^{2}\right )}{\left (f x + e\right )}}{{\left (a^{2} + b^{2}\right )} c^{4} + 2 \,{\left (a^{2} + b^{2}\right )} c^{2} d^{2} +{\left (a^{2} + b^{2}\right )} d^{4}} + \frac{2 \, d^{2}}{b c^{4} - a c^{3} d + b c^{2} d^{2} - a c d^{3} +{\left (b c^{3} d - a c^{2} d^{2} + b c d^{3} - a d^{4}\right )} \tan \left (f x + e\right )} - \frac{2 \,{\left (3 \, b c^{2} d^{2} - 2 \, a c d^{3} + b d^{4}\right )} \log \left (d \tan \left (f x + e\right ) + c\right )}{b^{2} c^{6} - 2 \, a b c^{5} d - 4 \, a b c^{3} d^{3} - 2 \, a b c d^{5} + a^{2} d^{6} +{\left (a^{2} + 2 \, b^{2}\right )} c^{4} d^{2} +{\left (2 \, a^{2} + b^{2}\right )} c^{2} d^{4}} - \frac{{\left (b c^{2} + 2 \, a c d - b d^{2}\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right )}{{\left (a^{2} + b^{2}\right )} c^{4} + 2 \,{\left (a^{2} + b^{2}\right )} c^{2} d^{2} +{\left (a^{2} + b^{2}\right )} d^{4}}}{2 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(a+b*tan(f*x+e))/(c+d*tan(f*x+e))^2,x, algorithm="maxima")

[Out]

1/2*(2*b^3*log(b*tan(f*x + e) + a)/((a^2*b^2 + b^4)*c^2 - 2*(a^3*b + a*b^3)*c*d + (a^4 + a^2*b^2)*d^2) + 2*(a*
c^2 - 2*b*c*d - a*d^2)*(f*x + e)/((a^2 + b^2)*c^4 + 2*(a^2 + b^2)*c^2*d^2 + (a^2 + b^2)*d^4) + 2*d^2/(b*c^4 -
a*c^3*d + b*c^2*d^2 - a*c*d^3 + (b*c^3*d - a*c^2*d^2 + b*c*d^3 - a*d^4)*tan(f*x + e)) - 2*(3*b*c^2*d^2 - 2*a*c
*d^3 + b*d^4)*log(d*tan(f*x + e) + c)/(b^2*c^6 - 2*a*b*c^5*d - 4*a*b*c^3*d^3 - 2*a*b*c*d^5 + a^2*d^6 + (a^2 +
2*b^2)*c^4*d^2 + (2*a^2 + b^2)*c^2*d^4) - (b*c^2 + 2*a*c*d - b*d^2)*log(tan(f*x + e)^2 + 1)/((a^2 + b^2)*c^4 +
 2*(a^2 + b^2)*c^2*d^2 + (a^2 + b^2)*d^4))/f

________________________________________________________________________________________

Fricas [B]  time = 3.99267, size = 1486, normalized size = 8.08 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(a+b*tan(f*x+e))/(c+d*tan(f*x+e))^2,x, algorithm="fricas")

[Out]

1/2*(2*(a^2*b + b^3)*c*d^4 - 2*(a^3 + a*b^2)*d^5 + 2*(a*b^2*c^5 - a^3*c*d^4 - 2*(a^2*b + b^3)*c^4*d + (a^3 + 3
*a*b^2)*c^3*d^2)*f*x + (b^3*c^5 + 2*b^3*c^3*d^2 + b^3*c*d^4 + (b^3*c^4*d + 2*b^3*c^2*d^3 + b^3*d^5)*tan(f*x +
e))*log((b^2*tan(f*x + e)^2 + 2*a*b*tan(f*x + e) + a^2)/(tan(f*x + e)^2 + 1)) - (3*(a^2*b + b^3)*c^3*d^2 - 2*(
a^3 + a*b^2)*c^2*d^3 + (a^2*b + b^3)*c*d^4 + (3*(a^2*b + b^3)*c^2*d^3 - 2*(a^3 + a*b^2)*c*d^4 + (a^2*b + b^3)*
d^5)*tan(f*x + e))*log((d^2*tan(f*x + e)^2 + 2*c*d*tan(f*x + e) + c^2)/(tan(f*x + e)^2 + 1)) - 2*((a^2*b + b^3
)*c^2*d^3 - (a^3 + a*b^2)*c*d^4 - (a*b^2*c^4*d - a^3*d^5 - 2*(a^2*b + b^3)*c^3*d^2 + (a^3 + 3*a*b^2)*c^2*d^3)*
f*x)*tan(f*x + e))/(((a^2*b^2 + b^4)*c^6*d - 2*(a^3*b + a*b^3)*c^5*d^2 + (a^4 + 3*a^2*b^2 + 2*b^4)*c^4*d^3 - 4
*(a^3*b + a*b^3)*c^3*d^4 + (2*a^4 + 3*a^2*b^2 + b^4)*c^2*d^5 - 2*(a^3*b + a*b^3)*c*d^6 + (a^4 + a^2*b^2)*d^7)*
f*tan(f*x + e) + ((a^2*b^2 + b^4)*c^7 - 2*(a^3*b + a*b^3)*c^6*d + (a^4 + 3*a^2*b^2 + 2*b^4)*c^5*d^2 - 4*(a^3*b
 + a*b^3)*c^4*d^3 + (2*a^4 + 3*a^2*b^2 + b^4)*c^3*d^4 - 2*(a^3*b + a*b^3)*c^2*d^5 + (a^4 + a^2*b^2)*c*d^6)*f)

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(a+b*tan(f*x+e))/(c+d*tan(f*x+e))**2,x)

[Out]

Timed out

________________________________________________________________________________________

Giac [B]  time = 1.38032, size = 730, normalized size = 3.97 \begin{align*} \frac{\frac{2 \, b^{4} \log \left ({\left | b \tan \left (f x + e\right ) + a \right |}\right )}{a^{2} b^{3} c^{2} + b^{5} c^{2} - 2 \, a^{3} b^{2} c d - 2 \, a b^{4} c d + a^{4} b d^{2} + a^{2} b^{3} d^{2}} + \frac{2 \,{\left (a c^{2} - 2 \, b c d - a d^{2}\right )}{\left (f x + e\right )}}{a^{2} c^{4} + b^{2} c^{4} + 2 \, a^{2} c^{2} d^{2} + 2 \, b^{2} c^{2} d^{2} + a^{2} d^{4} + b^{2} d^{4}} - \frac{{\left (b c^{2} + 2 \, a c d - b d^{2}\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right )}{a^{2} c^{4} + b^{2} c^{4} + 2 \, a^{2} c^{2} d^{2} + 2 \, b^{2} c^{2} d^{2} + a^{2} d^{4} + b^{2} d^{4}} - \frac{2 \,{\left (3 \, b c^{2} d^{3} - 2 \, a c d^{4} + b d^{5}\right )} \log \left ({\left | d \tan \left (f x + e\right ) + c \right |}\right )}{b^{2} c^{6} d - 2 \, a b c^{5} d^{2} + a^{2} c^{4} d^{3} + 2 \, b^{2} c^{4} d^{3} - 4 \, a b c^{3} d^{4} + 2 \, a^{2} c^{2} d^{5} + b^{2} c^{2} d^{5} - 2 \, a b c d^{6} + a^{2} d^{7}} + \frac{2 \,{\left (3 \, b c^{2} d^{3} \tan \left (f x + e\right ) - 2 \, a c d^{4} \tan \left (f x + e\right ) + b d^{5} \tan \left (f x + e\right ) + 4 \, b c^{3} d^{2} - 3 \, a c^{2} d^{3} + 2 \, b c d^{4} - a d^{5}\right )}}{{\left (b^{2} c^{6} - 2 \, a b c^{5} d + a^{2} c^{4} d^{2} + 2 \, b^{2} c^{4} d^{2} - 4 \, a b c^{3} d^{3} + 2 \, a^{2} c^{2} d^{4} + b^{2} c^{2} d^{4} - 2 \, a b c d^{5} + a^{2} d^{6}\right )}{\left (d \tan \left (f x + e\right ) + c\right )}}}{2 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(a+b*tan(f*x+e))/(c+d*tan(f*x+e))^2,x, algorithm="giac")

[Out]

1/2*(2*b^4*log(abs(b*tan(f*x + e) + a))/(a^2*b^3*c^2 + b^5*c^2 - 2*a^3*b^2*c*d - 2*a*b^4*c*d + a^4*b*d^2 + a^2
*b^3*d^2) + 2*(a*c^2 - 2*b*c*d - a*d^2)*(f*x + e)/(a^2*c^4 + b^2*c^4 + 2*a^2*c^2*d^2 + 2*b^2*c^2*d^2 + a^2*d^4
 + b^2*d^4) - (b*c^2 + 2*a*c*d - b*d^2)*log(tan(f*x + e)^2 + 1)/(a^2*c^4 + b^2*c^4 + 2*a^2*c^2*d^2 + 2*b^2*c^2
*d^2 + a^2*d^4 + b^2*d^4) - 2*(3*b*c^2*d^3 - 2*a*c*d^4 + b*d^5)*log(abs(d*tan(f*x + e) + c))/(b^2*c^6*d - 2*a*
b*c^5*d^2 + a^2*c^4*d^3 + 2*b^2*c^4*d^3 - 4*a*b*c^3*d^4 + 2*a^2*c^2*d^5 + b^2*c^2*d^5 - 2*a*b*c*d^6 + a^2*d^7)
 + 2*(3*b*c^2*d^3*tan(f*x + e) - 2*a*c*d^4*tan(f*x + e) + b*d^5*tan(f*x + e) + 4*b*c^3*d^2 - 3*a*c^2*d^3 + 2*b
*c*d^4 - a*d^5)/((b^2*c^6 - 2*a*b*c^5*d + a^2*c^4*d^2 + 2*b^2*c^4*d^2 - 4*a*b*c^3*d^3 + 2*a^2*c^2*d^4 + b^2*c^
2*d^4 - 2*a*b*c*d^5 + a^2*d^6)*(d*tan(f*x + e) + c)))/f